<?php

class VkController extends Zend_Controller_Action
{

    public function init() {
         
         
         $this->_helper->layout->setLayout('vksp');
    }
    
    public function shporsAction(){
        
        $vkManager = new \Managers\Vk();
        
        $f = file_get_contents('./images/vk-2045241/list.db');
        $f = explode("\n", $f);
        $this->view->list =  $f;
        
        if ($this->_request->getParam('sub')){
           $vkManager->saveComment($this->_getAllParams());
           $this->_redirect($this->view->url(array(), 'vk'));
        }
        
        
    }
    
    
    public function shporscommAction(){
    
        $vkManager = new \Managers\Vk();
        $this->view->allMessages = $vkManager->getAllMessages();
    }
    
    
    public function fbAction(){
                    $vkManager = new \Managers\Vk();
        
        $f = file_get_contents('./images/vk-2045241/list.db');
        $f = explode("\n", $f);
        $this->view->list =  $f;
        
        if ($this->_request->getParam('sub')){
           $vkManager->saveComment($this->_getAllParams());
           $this->_redirect($this->view->url(array(), 'vk'));
        }

    }
    
    
}

